-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAYA-112608: add grouping with absolute, relative, world flags. #1600
Conversation
HamedSabri-adsk
commented
Jul 25, 2021
Ufe::SceneItem::Ptr | ||
createGroup(const Ufe::Selection& selection, const Ufe::PathComponent& name) const override; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding guards against UFE v0.3.5 since selection is no longer passed to group command.
@@ -76,7 +85,7 @@ void UsdUndoCreateGroupCommand::execute() | |||
_groupCompositeCmd->append(setKindCmd); | |||
setKindCmd->execute(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the plugin side, we only need to create the groupItem and set its Kind.
On the Maya side, the insertion (a.k.a move ) happens with support for different flag options.
if ufeUtils.ufeFeatureSetVersion() >= 3: | ||
cmds.undo() | ||
else: | ||
groupCmd.undo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test now uses the cmds::undo() and cmds::redo() instead of groupCmd.
@@ -107,6 +116,7 @@ void UsdUndoCreateGroupCommand::execute() | |||
|
|||
throw; // re-throw the same exception | |||
} | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groupItem selection is now handled on the Maya side.
return std::make_shared<UsdUndoCreateGroupCommand>(parentItem, selection, name); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these UFE V3 guards should be cleaned up after switching to UFE V3.
@@ -99,7 +130,7 @@ def testUsdGroup(self): | |||
self.assertEqual("ballset.usda", layer.GetDisplayName()) | |||
stage.SetEditTarget(layer) | |||
|
|||
if (ufeUtils.ufeFeatureSetVersion() >= 3): | |||
if (os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') > '3000'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against UFEV3.1.
@@ -124,7 +155,7 @@ def testUsdGroup(self): | |||
|
|||
# The command will now append a number 1 at the end to match the naming | |||
# convention in Maya. | |||
if (ufeUtils.ufeFeatureSetVersion() >= 3): | |||
if (os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') > '3000'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against UFEV3.1.
test/lib/ufe/testGroupCmd.py
Outdated
pass | ||
# TODO: for some strange reasons the globalSelection returns 0?? | ||
# I tried the same steps in interactive Maya and it correctly returns 2 | ||
# self.assertEqual(len(globalSelection), 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppt-adsk I am going to investigate this tomorrow morning. For some odd reasons the globalSelection length after undo is reported az 0. This can't be true, since there are 2 items in selection after undo.
I tried the exact same steps in interactive Maya and it all behaves as expected.
stage.GetPrimAtPath("/group1/Sphere1"), | ||
stage.GetPrimAtPath("/group2"), | ||
stage.GetPrimAtPath("/group2/Sphere2"), | ||
stage.GetPrimAtPath("/group2/Sphere3")]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple test to verify world
flag.
When this flag is enabled, the new group is put under the world.
- verify undo/redo
# no TRS attributes | ||
self.assertFalse(newspherePrim.HasAttribute('xformOp:translate')) | ||
self.assertFalse(newspherePrim.HasAttribute('xformOp:rotateXYZ')) | ||
self.assertFalse(newspherePrim.HasAttribute('xformOp:scale')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple test to verify relative
flag
@ppt-adsk Maya sides of changes was merged in this morning. Thanks to @fowlertADSK |
Looks like PF passed on all machines but "2020 Linux python2" and "2022 Linux python2" machines failed to launch mysteriously.
marking this as Ready-To-Merge. |